<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=3,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
	<title>提现申请</title>
	<link href="css/public/reset-html5.css" rel="stylesheet">
	<link href="css/public/mui.min.css" rel="stylesheet">
	<link href="css/wx-main.css?20161028_1" rel="stylesheet">
	<link rel="stylesheet" href="css/orderlist.css">
	<link rel="stylesheet" href="css/admin.css">
</head>
<body id="main">
<div class="mui-card money">
	<div class="pane">
		<div>账户余额</div>
		<div v-text="accountDetail.m_money"></div>
	</div>
	<div class="pane">
		<div>可提现金额</div>
		<div v-text="accountDetail.available_money"></div>
	</div>
	<div class="money-input">
		<div style="white-space:nowrap;">提现金额：</div>
		<input type="number" v-model="a_money">
	</div>
</div>
<div style="padding:20px 10px;"><button v-on:click="withdraw()" :disabled="!a_money">确认提现</button></div>

</body>
<script src="../js/jquery-2.2.1.min.js"></script>
<script src="../plugins/vue/vue.min.js"></script>
<script src="js/phone.js"></script>
<script src="js/public.js"></script>
<script src="layer_mobile/layer.js"></script>
<script>
	var vue = new Vue({
		el: "#main",
		data: {
			accountDetail:[],
			a_money:''
		},
		methods: {
			withdraw:function(){
				var thiz = this;
				if(confirm("确认提现"+vue.a_money+"元到微信账户？")){
					var index = layer.open({type: 2,shadeClose:false});
					$.post(apiRecycle+"index.php/Home/AccountDetails/add_account_details", {
						a_money:thiz.a_money
					}, function(res){
						layer.close(index);
						if(res.code == 200){
							location.href="admin.html";
						} else {
							alert(res.message);
						}
					}, "json");
				}
			},
			
			/*加载回收订单*/
			loadAccountData:function(){
				var index = layer.open({type: 2,shadeClose:false});
				$.get(apiRecycle+"index.php?m=Home&c=AccountDetails&a=account_user", {}, function(res){
					vue.accountDetail = res.data;
					layer.close(index);
				}, "json");
			}
		},
		ready: function () {
			this.loadAccountData();
		}
	});
</script>
</html>